package com.bbs.core.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bbs.core.model.Reply;
import com.bbs.core.service.ReplyService;
import com.bbs.core.service.UserService;
import com.bbs.core.dao.ReplyDao;

@Service(value = "replyService")
public class ReplyServiceImpl implements ReplyService{
	
	@Autowired
	private ReplyDao replyDao;
	
	@Autowired
	private UserService userService;
	
	@Override
	public void saveReply(Reply reply) {
		replyDao.insert(reply);
		userService.addReplayScore(reply.getUserId());
	}

	@Override
	public void deleteByPrimaryKey(Integer id) {
		replyDao.deleteByPrimaryKey(id);
		
	}

}
